using System;
using System.IO;


namespace Facebook.Compact
{
    class FileHelper
    {
        public static byte[] ReadAllBytes(string filename)
        {
            if (!File.Exists(filename))
            {
                throw new FileNotFoundException(filename);
            }

            FileInfo fi = new FileInfo(filename);
            byte[] contents = new byte[fi.Length];

            FileStream fs = File.OpenRead(filename);
            int bytesRead = fs.Read(contents, 0, contents.Length);
            fs.Close();

            return contents;
        }
    }
}
